<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Rain
{
	function Rain ()
	{
		$this->ci =& get_instance ();
		
		$this->ci->load->config ('rain');
		$this->ci->lang->load ('rain');
		
		if ($this->ci->config->item ('RAIN_debug'))
		{
			$this->ci->output->enable_profiler (TRUE);
		}
	}
	
	function authorize ($login = FALSE)
	{
		if ( ! $login)
		{
			if ( ! $this->ci->dx_auth->is_logged_in ())
			{
				redirect ('auth/login');
				die ();
			}
		}
	}
}